<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ page import="java.util.*,
				 com.kylin.common.*,
				 com.kylin.common.util.*,
				 com.kylin.common.paginate.*,
				 com.kylin.module.study.orm.*"%>
<%@ include file="/common/include/taglibs.jsp"%>
<%@ include file="/common/include/pageExpires.jsp"%>
<%@ include file="/common/include/dictNames.jsp"%>
 
<table width="90%" border="0" align="center">
	<tr>
		<td align="left">
			学习管理→课件管理→课件列表
		</td>
	</tr>
</table>
<p>
	&nbsp;
</p>
<p>
	&nbsp;
</p>
<form action="/admin/study/manageCourseware.do?CMD=search" method="post" >
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td height="22" align="right">
			母语：
		</td>
		<td align="left">
      <mytag:national name="language" dictName="<%=Constants.SYSLANGUAGE%>" />
		</td>
	</tr>
	<tr>
		<td height="21" align="right">
			学习语言：
		</td>
		<td align="left">
      <mytag:national name="targetlang" dictName="<%=Constants.SYSLANGUAGE%>" />
		</td>
	</tr>
	<tr>
		<td height="19" align="right">
			所属分类：
		</td>
		<td align="left">
      <mytag:select name="catcourseware" dictName="<%=dict_cat_study2%>" />
		</td>
	</tr>
	<tr>
		<td height="18" align="right">
			课件名称：
		</td>
		<td align="left">
			<input type="text" name="keyword_title" />
		</td>
	</tr>
	<tr>
		<td height="18" align="right">
			译文：
		</td>
		<td align="left">
			<input type="text" name="keyword_translate" />
		</td>
	</tr>
	<tr>
		<td height="29" align="right"> &nbsp; </td>
		<td>
			<input name="button2" type="submit" value="查询" />
		</td>
	</tr>
</table>
</form>
<br />
<script>
    function deleteOne(delUrl){
        if(confirm("确定要删除此条数据吗？") ){
            location.href = delUrl ;
        }
    }

	function playMedia(filetype,imgobj){
	    document.fo2.fileType.value = filetype
	    document.fo2.fileUrl.value = imgobj.value
	    document.fo2.submit();
	}
</script>
<form name="fo2" action="/common/playMedia.jsp" target="_blank">
<input type="hidden" name="fileType" >
<input type="hidden" name="fileUrl" >
<table width="90%" border="0" align="center">
  <tr>
    <td>汉语 & 英语</td>
    <td align="right"><a href="coursewareAdd.jsp">添加课件</a></td>
  </tr>
</table>
<table width="90%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight=#AAAAAA bordercolordark=white>
  <tr align="center" bgcolor="F2F2F2">
    <td height="25"> 序号 </td>
    <td> 标题 </td>
    <td> 所属分类 </td>
    <td> 语音 </td>
    <td> 操作 </td>
  </tr>
<%
	DisplayPage dispage = null;
    if(request.getAttribute(Constants.KEY_REQUEST_RESULT   )!=null){
        dispage = (DisplayPage)request.getAttribute(Constants.KEY_REQUEST_RESULT);
        String deleteUrl = "/admin/study/manageCourseware.do?CMD=delete&page="
		+ dispage.getPageNumber()
		+ "&searchId="
		+ dispage.getSearchId();
		String editUrl = "/admin/study/manageCourseware.do?CMD=update&page="
		+ dispage.getPageNumber();
		String detailUrl = "/admin/study/manageCourseware.do?CMD=detail&id=";
		for (int i = 0; i < dispage.getList().size(); i++) {
			Courseware obj = (Courseware) dispage.getList().get(i);      
%>
		  <tr>
		    <td align="center"><%=(i+1)%></td>
		    <td align="left">&nbsp; <a href="<%=detailUrl + obj.getId()%>">
		    	[<%=UTool.getLanguageName(obj.getLanguage(),sessionLocale) %>]
							<%=obj.getTitle() %></a>
			</td>
		    <td align="center"><%=obj.getDict() %></td>
		    <td align="center">
		    <%
		        if(obj.getMediapath()!=null && !obj.getMediapath().equals("") ){
		    %>
		    <input type="hidden" name="imgpath<%=obj.getId() %>" value="<%=obj.getMediapath()%>">    
		        <img src="/images/lessonpic01.gif" width="13" height="13" stype="cursor:hand"
		           onclick="playMedia('<%=Constants.MEDIA_COURSE%>',document.fo2.imgpath<%=obj.getId()%>)"/>
		    <%
		        }
		    %>
		    </td>
		    <td align="center">
		          <a href="<%=editUrl + "&id=" + obj.getId()%>">编辑</a>|
		          <a href="#" onclick="deleteOne('<%=deleteUrl + "&id=" + obj.getId()%>')">删除</a> 
		    </td>

		  </tr>
<%
        }
    }
%>  
</table>
</form>
<%
     //调用共通方法生成翻页工具条
	 out.print(JspHelper.getPageBar(dispage,request.getRequestURL()+"?CMD=search"));

%>
